import React from 'react'
import '../../assets/css/common.scss';

function Modal(props) {

    const { isShowModal, modalTitle, children } = props;
    // 此处对于查看、编辑按钮组件使用了类似插槽的方法，其中children便是插槽组件内容
    return (
        <>
            {
                isShowModal
                    ?
                    (
                        <div className='modal'>
                            <div className='inner'>
                                <div className='m-header'>{modalTitle}</div>
                                <div className='content-wrapper'>{children}</div>
                            </div>
                        </div>
                    )
                    :
                    ''
            }
        </>
    )
}

export default Modal